package de.rj.urwalking.config;

/**
 * 
 * Config values that may change sometimes
 * 
 * @author rjj
 * 
 */
public class Config {

	public static final String TAG = "URwalking";

	/** Flag for disabling logcat messages in production versions */
	public static final boolean DEBUG = true;

	/** Flag for disabling crash reporting while programming */
	public static final boolean CRASH_REPORTING = false;

	public static final String FOLDER_NAME = "URwalking";

	public static final String DB_URL = "jdbc:postgresql://132.199.143.90/urw_nadine";
	public static final String DB_USER = "urwsecure";
	public static final String DB_PASSWORD = "Nb4o3fKY3vX26QRw8";

	/**
	 * URL pointing to the latest app version on the server. FIXME: change URL!
	 */
	public static final String LATEST_VERSION_URL = "https://dl.dropboxusercontent.com/u/23232710/todo.png";

	/**
	 * URL of the PHP script we use to retrieve the images for picture-based scales.
	 */
	public static final String PICTURE_URL = "http://132.199.143.90/testing/new_src/image.php?pictureid=";

	/**
	 * How many meters from the last location until we start loading new buildings, POIs and existing landmarks.
	 */
	public static final double LOCATION_THRESHOLD = 25;

	/**
	 * Using a different threshold for manual movement (= testing)
	 */
	public static final double MANUAL_LOCATION_THRESHOLD = 10;

	/**
	 * How often we want to have sensor readings.
	 */
	public static final int SENSOR_DELAY_MILLISECONDS = 500;
	public static final int SENSOR_DELAY_NANOSECONDS = SENSOR_DELAY_MILLISECONDS * 1000000;

	/**
	 * How often the frames per second are logged when the 3D engine is running
	 */
	public static final int FPS_LOG_INTERVAL = 10000; // milliseconds

	/**
	 * How much the compass (magnetometer) output is smoothed to avoid jittering
	 */
	public static final float COMPASS_SMOOTHING = 0.01f;

	/**
	 * Used to scale buildings a little bit smaller than their actual size to avoid overlapping faces, resulting in
	 * z-fighting and flickering.
	 */
	public static final float BUILDING_SCALE_FACTOR = 0.995f;

	/**
	 * Defines if we use stars or traditional radio buttons for the rating questions.
	 */
	public static final boolean USE_STAR_RATING = false;

	// FIXME: hardcoded database IDs!
	public static final int TEST_PARTICIPANT_ID = 224;
	public static final int TEST_EXPERIMENT_ID = 6;
	public static final int CREATE_PARTICIPANT_SURVEY_NR = 5;

	public static final int SCALE_LIKERT7 = 17;
	public static final int SCALE_LIKERT5 = 12;
	public static final int SCALE_YESNO = 16;
	public static final int SCALE_YESNO2 = 18;
	public static final int SCALE_BINARY = 11;
	public static final int SCALE_CATEGORY = 6;
	public static final int SCALE_FREETEXT = 10;
	public static final int SCALE_NO_SCALE = 13;
	public static final int SCALE_OBJECT_LOCATION = 14;
	public static final int SCALE_GENDER = 7;
	public static final int SCALE_AGREEMENT = 15;
	public static final int SCALE_COUNTRIES = 19;
	public static final int SCALE_INTENSITY = 22;
	public static final int SCALE_LIKERT5_ZUSTIMMUNG = 23;

	public static final int STATUS_CANCELLED = 5;
	public static final int STATUS_FINISHED = 4;

	/**
	 * The uniqueid of the yes/no question where the participant accepted/rejected the terms of service.
	 */
	public static final int QUESTION_ID_TOS = 264;
	/**
	 * The uniqueid of the free text question where the user enters a name for the salient object. Used to display the
	 * name of the object in the 3D view.
	 */
	public static final int QUESTION_ID_NAME = 214; // FIXME: we really should read this from the DB somehow
	public static final int QUESTION_ID_NAME2 = 281;// FIXME: we really should read this from the DB somehow

	/**
	 * The scalepoint values of the category question that require an additional text field for free text input
	 * ("Sonstiges")
	 */
	public static final int[] SCALEPOINTS_OTHER = new int[] { 6, 8 };

	// information regarding upload of log files
	public static final int FILE_UPLOAD_INTERVAL_STANDARD = 30 * 1000;
	public static final int FILE_UPLOAD_INTERVAL_FAILURE = 1 * 60 * 1000;
	public static final String FILE_UPLOAD_SERVER = "132.199.143.90/logdata";
	public static final String FILE_UPLOAD_PHP = "/logdata2.php";

	public static final int MAXIMUM_TRIALS_ZERO_FILES = 3;

	public static final char SENSORDATA_SEPARATOR = ',';
	public static final int SENSOR_ID_STEPDETECTOR = 150; // FIXME: set to whatever value is used in the DB

	public static final String UPLOADTAG = "URWalking.Upload";
}
